<div class="latest-car">
    <div class="sidebar-caption">Последние поступления</div>
    <ul class="rotator-lates">
        <li><a class="active" href="" rel="slide-1"><span>1</span></a></li>
        <li><a href="" rel="slide-2"><span>2</span></a></li>
        <li><a href="" rel="slide-3"><span>3</span></a></li>
        <li><a href="" rel="slide-4"><span>4</span></a></li>
        <li><a href="" rel="slide-5"><span>5</span></a></li>
    </ul>
    <ul class="left-car-list latest-car-list">
        <?php $limit = 6; $i = 1; $group=1; ?>
        <?php foreach ($this->autos as $auto):?>
            <?php
                $photo = $auto['mainPhotoUrl'];
                if(!$photo) {
                    $photo = 'images/nophoto/'.$auto['categoryId'].'l.jpg';
                } else {
                    $photo = $this->getImage($photo);
                }
            ?>
            <li class="slide slide-<?= $group; ?>">
                <a href="<?= $this->url_Auto($auto['id'], $auto['mark']['name'], $auto['model']['name']) ?>" style="position: relative;">
                    <img width="65" height="49" src="<?= $photo ?>" alt="Фото <?= $auto['mark']['name']." ".$auto['model']['name']?>" />
                    <span class="model-year"><?= $auto['mark']['name']." ".$auto['model']['name']?><?= ($auto['years'])?' '.$auto['years']:'';?></span>
                    <span class="price"><?= $this->formatCurrency($auto['price'], $auto['currencyId']);?></span>
                    <span class="city"><?= $auto['city']['name']?></span>
                    <em></em>
                </a>
            </li>

            <?php
                if($i == $limit ){
                    $group++;
                    $i = 1;
                } else {
                    $i++;
                }
            ?>
        <?php endforeach;?>
    </ul>
</div>